package top.lidee.module.backendApi.twice.management.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.lidee.common.service.twice.management.MtStoreWechatInputPieceLogService;
import top.lidee.framework.result.PageUtils;
import top.lidee.framework.result.ResponseResult;
import top.lidee.repository.model.twice.pojo.management.MtStoreWechatInputPieceLogEntity;

import java.util.Arrays;
import java.util.Map;

/**
 * 特约商户/收付通进件记录表
 *
 * @author zhangzhan
 * @email 52194440@qq.com
 * @date 2024-09-30 17:39:38
 */
@Api("特约商户/收付通进件记录表")
@RestController
@RequestMapping("/backendApi/mtstorewechatinputpiecelog")
public class MtStoreWechatInputPieceLogController {
    @Autowired
    private MtStoreWechatInputPieceLogService mtStoreWechatInputPieceLogService;

    /**
     * 列表
     */
    @RequestMapping(value = "/list",method = RequestMethod.POST)
    @ApiOperation(value = "特约商户/收付通进件记录表列表")
    public ResponseResult list(@RequestBody Map<String, Object> params){
        PageUtils page = mtStoreWechatInputPieceLogService.queryPage(params);

        return ResponseResult.okResultPage("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping(value = "/info/{id}",method = RequestMethod.GET)
    @ApiOperation(value = "特约商户/收付通进件记录表信息")
    public ResponseResult info(@PathVariable("id") Integer id){
		MtStoreWechatInputPieceLogEntity mtStoreWechatInputPieceLog = mtStoreWechatInputPieceLogService.getById(id);

        return ResponseResult.okResultPage("MtStoreWechatInputPieceLog", mtStoreWechatInputPieceLog);
    }

    /**
     * 保存
     */
    @RequestMapping(value = "/save",method = RequestMethod.POST)
    @ApiOperation(value = "特约商户/收付通进件记录表保存")
    public ResponseResult save(@RequestBody MtStoreWechatInputPieceLogEntity mtStoreWechatInputPieceLog){
		mtStoreWechatInputPieceLogService.save(mtStoreWechatInputPieceLog);

        return ResponseResult.ok();
    }

    /**
     * 修改
     */
    @RequestMapping(value = "/update",method = RequestMethod.PUT)
    @ApiOperation(value = "特约商户/收付通进件记录表修改")
    public ResponseResult update(@RequestBody MtStoreWechatInputPieceLogEntity mtStoreWechatInputPieceLog){
		mtStoreWechatInputPieceLogService.updateById(mtStoreWechatInputPieceLog);

        return ResponseResult.ok();
    }

    /**
     * 删除
     */
    @RequestMapping(value = "/delete",method = RequestMethod.DELETE)
    @ApiOperation(value = "特约商户/收付通进件记录表删除")
    public ResponseResult delete(@RequestBody Integer[] ids){
		mtStoreWechatInputPieceLogService.removeByIds(Arrays.asList(ids));

        return ResponseResult.ok();
    }

}
